package com.hs.monitor.message;

import com.hs.monitor.communication.Mqtt;
import com.hs.monitor.utils.ByteUtil;
import com.hs.monitor.utils.LogUtil;
import org.eclipse.paho.client.mqttv3.MqttMessage;

public class Sender {

    public static String topic;
    public static void send(byte[] msg) {
//        System.out.println();
        LogUtil.log("设备>>>平台：" + ByteUtil.bytesToHex(msg));
        MqttMessage message = new MqttMessage(msg);
        //发布
        Mqtt.publish(topic,message);
    }
}
